package com.xijing.dao;

import java.sql.Connection;
import java.sql.DriverManager;

public class BaseDAO {

	private static final String DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
	private static final String URL = "jdbc:sqlserver://localhost:1433;databaseName=HotelManager";
	private static final String USER = "sa";
	private static final String PWD = "zhrmghg";
	// 数据库连接相关参数
	//private String DRIVER = "oracle.jdbc.driver.OracleDriver";
	//private String URL = "jdbc:oracle:thin:@localhost:1521:orcl";


	public Connection getConnection() {
		Connection conn = null;
		try {
			Class.forName(DRIVER);
			conn = DriverManager.getConnection(URL, USER, PWD);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return conn;
	}

}
